import request from '@/utils/axios'

// 患者列表
export const getPatientList = (data: any) => {
  return request.post({ url: '/eprofile-web/api/patient/info/page', data })
}
export const counselingPage = (data: any) => {
  return request.post({ url: '/eprofile-web/api/health/counseling/page', data })
}
// 患者列表
export const getallPatientList = (data: any) => {
  return request.post({ url: '/eprofile-web/api/user/all_patient/page', data })
}
// 患者列表
export const getADPatientList = (data: any) => {
  return request.post({ url: '/eprofile-web/api/manage/info/page', data })
}

// 患者基本信息
export const getPatientInfo = (data: any) => {
  return request.get({ url: `/eprofile-web/api/patient/info/info/${data.empi}` })
}

// 管理标签列表
export const getPatientManage = () => {
  return request.get({ url: `/eprofile-web/api/label/info/list` })
}

// 患者标签
export const getPatientLabel = (data: any) => {
  return request.get({ url: `/eprofile-web/api/label/info/patientLabel?empi=${data.empi}` })
}

// 保存患者管理标签
export const savePatientManage = (data: any) => {
  return request.post({ url: '/eprofile-web/api/label/info/savePatientLabel', data })
}

// 确诊信息
export const getPatientDiagnosis = (data: any) => {
  return request.get({ url: `/eprofile-web/api/label/info/confirm/${data.empi}` })
}

// 现有疾病
export const getPatientDisease = (data: any) => {
  return request.get({ url: `/eprofile-web/api/diag/record/list/${data.empi}` })
}

// 确诊疾病列表
export const getPatientDiag = (data: any) => {
  return request.get({ url: `/eprofile-web/api/label/info/list/confirm/${data.empi}` })
}

// 风险疾病
export const getPatientRisk = (data: any) => {
  return request.get({ url: `/eprofile-web/api/label/info/list/risk/${data.empi}` })
}

// 风险疾病详情
export const getPatientRiskDetail = (data: any) => {
  return request.get({
    url: `/eprofile-web/api/label/info/risk/${data.empi}/${data.labelCode}/${data.riskLevel}`
  })
}

// 健康检测 体征信息 全部
export const getPatientTest = (data: any) => {
  // return request.get({ url: '/eprofile-web/api/patient/info/signs-info', params: data })
  return request.get({ url: `/eprofile-web/api/signs/info/all/${data.empi}` })
}

// 查询体征信息
export const getPatientSigns = (data: any) => {
  return request.post({ url: '/eprofile-web/api/signs/info/list', data })
}
// 查询新增体征信息
export const getNewPatientSigns = (data: any) => {
  return request.post({ url: '/eprofile-web/api/signs/info/new_list', data })
}
export const queryUserHisReportDetail = (data: any) => {
  return request.get({
    url: '/eprofile-web/api/web/patient/indicator/report/queryUserHisReportDetail',
    method: 'get',
    data: data
  })
}
export const infoCharts = (data: any) => {
  return request.post({ url: '/eprofile-web/api/signs/info/chart', data })
}
export const reportChart = (data: any) => {
  return request.get({
    url: '/eprofile-web/api/web/patient/indicator/report/chart',
    method: 'get',
    data: data
  })
}

// 就诊记录
export const getPatientVisit = (data: any) => {
  return request.get({ url: `/eprofile-web/api/visit/record/list/${data.empi}` })
}

// 既往史
export const getPatientHistory = (data: any) => {
  return request.get({ url: `/eprofile-web/api/patient/info/history/${data.empi}` })
}

// 当前用药
export const getPatientMedicine = (data: any) => {
  return request.get({ url: `/eprofile-web/api/patient/info/drug/${data.empi}` })
}

// 获取所有的体检
export const getPatientCheckUpTime = (data: any) => {
  return request.get({ url: `/eprofile-web/api/patient/info/pe/${data.empi}` })
}

// // 体检信息
// export const getPatientCheckUp = (data: any) => {
//   return request.get({ url: `/eprofile-web/api/patient/info/pe/${data.empi}/${data.time}` })
// }

// 评估建议
export const getPatientEvaluate = (data: any) => {
  return request.get({ url: `/eprofile-web/api/task/info/get/${data.empi}` })
}

// 风险评分
export const getPatientScore = (data: any) => {
  return request.get({ url: `/eprofile-web/api/scale/info/${data.empi}/${data.subLabelCode}` })
}

// 更多信息
// 更多信息--既往史
export const getPatientInfoHistory = (data: any) => {
  return request.get({ url: `/eprofile-web/api/patient/info/history/info/${data.empi}` })
}

// 随访记录
export const getPatientFollowUp = (data: any) => {
  return request.get({
    url: `/eprofile-web/api/task/detail/queryFollow/${data.empi}`
  })
}

// 人工随访列表
export const getPatientArtificial = (data: any) => {
  return request.post({
    url: `/eprofile-web/api/patient/follow/record/page`,
    data
  })
}

// 人工随访保存
export const savePatientArtificial = (data: any) => {
  return request.post({
    url: '/eprofile-web/api/patient/follow/record/save',
    data
  })
}

// 获取健康日记月历
export function heppatientdiaryMonthList(data: any) {
  return request.get({
    url: '/eprofile-web/api/heppatientdiary/month-list',
    method: 'get',
    data: data
  })
}

// 获取健康日记列表
export function heppatientdiaryList(data: any) {
  return request.get({
    url: '/eprofile-web/api/heppatientdiary/list',
    method: 'get',
    data: data
  })
}

// 获取饮食日期
export function foodDateList(data: any) {
  return request.get({
    url: '/eprofile-web/api/diet/info/date-list',
    method: 'get',
    data: data
  })
}

// 获取饮食信息列表
export function foodInfoList(data: any) {
  return request.get({
    url: '/eprofile-web/api/diet/info/list',
    method: 'get',
    data: data
  })
}

// 上传图片
export const infoUpload = (data: any) => {
  return request.upload({
    url: '/eprofile-web/api/diet/info/upload',
    data: data
  })
}

// 获取饮食能量
export const infotGetEnergy = (data: any) => {
  return request.get({
    url: '/eprofile-web/api/diet/info/getEnergy',
    method: 'get',
    data: data
  })
}

// 保存或修改饮食信息
export const infotSave = (data: any) => {
  return request.post({
    url: '/eprofile-web/api/diet/info/save',
    data
  })
}

// 获取患者的管理路径
export const getPatientPath = (data: any) => {
  return request.get({
    url: `/eprofile-web/api/patient/info/manage/plan?empi=${data.empi}`,
    method: 'get'
  })
}

// 根据问卷id查询问卷信息
export const getQuestionnaireInfo = (data: any) => {
  return request.get({
    url: `/path/api/api/questionnaire/info/${data.questionnaireId}`,
    method: 'get'
  })
}

// 根据问卷答案id查询问卷答案
export const getQuestionnaireAnswer = (data: any) => {
  return request.get({
    url: `/eprofile-web/api/question/answer/${data.questionnaireRecordId}/${data.empi}`,
    method: 'get'
  })
}
